import java.util.LinkedList;

public class LibraryUsers {
    private LinkedList<User> userList;

    public LibraryUsers() {
        userList = new LinkedList<User>();
        userList.add(new User("111-1111", "testpass", "Sophie", "sophie@gmail.com", "555-5555"));
    }

    public User validateUser(String username, String password){
        for (User member : userList){
            if( username.equals(member.getUserName()) ){
                if ( member.validatePassword(password) )
                    return member;
                System.out.println("Invalid password.");
            }
            else
                System.out.println("Invalid username.");
        }
        return null;
    }
}
